import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsNotEmpty, IsOptional, IsString } from "class-validator";

export class CreateDraftDto {
  @ApiProperty({ description: "任务名称", type: String })
  @IsString({ message: "任务名称必须是字符串" })
  @IsOptional()
  taskName: string;

  @ApiProperty({ description: "内容", type: String })
  @IsNotEmpty({ message: "内容不能为空" })
  @IsString({ message: "内容必须是字符串" })
  content: string;

  @ApiProperty({ description: "图片", type: String })
  @IsString({ message: "图片必须是字符串" })
  @IsOptional()
  images: string;

  @ApiProperty({ description: "标签时间", type: String })
  @IsString({ message: "选择内容标签" })
  tag: string;

  @ApiProperty({ description: "发布日期", type: String })
  @IsNotEmpty({ message: "发布日期不能为空" })
  @IsString({ message: "发布日期为字符串" })
  date: string;

  @ApiProperty({ description: "发布时间", type: String })
  @IsNotEmpty({ message: "发布时间不能为空" })
  @IsString({ message: "发布时间为字符串" })
  time: string;

  @ApiProperty({ description: "是否设置为模板", type: String })
  @IsBoolean({ message: "模板为布尔类型" })
  @IsOptional()
  isTemplate: boolean;
}
